package com.leyou.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @version 1.0.0
 * @Author yong.Mr
 * @data 2019-8-9
 */
public class ThreadUtils {

    // 使用Executors创建定量线程池，可以提高并发量
    private static final ExecutorService es = Executors.newFixedThreadPool(10);

    public static void execute(Runnable runnable){
        // 调用submit或者execute方法提交线程，主线程不会等待
        es.submit(runnable);
        System.out.println("adsada");
    }
}
